//
//  MZMainTabBarController.swift
//  HiPlayer
//
//  Created by LB on 16/7/18.
//  Copyright © 2016年 TianChaoMinZu. All rights reserved.
//

import UIKit

class MZMainTabBarController: UITabBarController {

    override func viewDidLoad() {
        super.viewDidLoad()

        addChildViewControllers()
    }
}

extension MZMainTabBarController {
    private func addChildViewControllers() {
        addChildViewController(MZMinViewController(), title: "民", normalImage: UIImage(named: "tabbar_home")!, selectedImage: UIImage(named: "tabbar_home_highlighted")!)
        addChildViewController(MZZuViewController(), title: "族", normalImage: UIImage(named: "tabbar_profile")!, selectedImage: UIImage(named: "tabbar_profile_highlighted")!)
    }
}

extension MZMainTabBarController {
    private func addChildViewController(vc:UIViewController,
                                        title:String,
                                        normalImage:UIImage,
                                        selectedImage:UIImage) {
        vc.title = title
        vc.tabBarItem.image = normalImage
        vc.tabBarItem.selectedImage = selectedImage
        let nav = UINavigationController(rootViewController: vc)
        self.addChildViewController(nav)
    }
}
